// 封装接口
import request from '@/utils/request'
// 获取分类管理 数据
export function getCategories(params) {
  return request({
    url: '/categories',
    method: 'get',
    params
  })
}
// 新增分类
export function addCategories(data) {
  return request({
    url: '/categories',
    method: 'post',
    data
  })
}
// 删除
export function deleteCategories(id) {
  return request({
    url: '/categories/' + id,
    method: 'delete'

  })
}

// 根据id获取指定详情
export function getCategoriesId(id) {
  return request({
    url: '/categories/' + id,
    method: 'get'
  })
}

// 根据id更新角色
export function editCategories(data) {
  return request({
    url: '/categories/' + data.id,
    method: 'put',
    data
  })
}
export function getCategoriesCount(params) {
  return request({
    url: '/categories/count',
    method: 'get',
    params
  })
}
